<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<h:outputText value="Leave Types" styleClass="outputTextTitle" />
			
			<h:panelGrid columns="1" >
				<h:panelGrid columns="2" style="">
					<h:outputLabel value="#{msg['leavetype.label']}" />
					<p:selectOneMenu value="#{leaveTypesBean.selectedLeaveTypeId}">
					 <f:selectItem itemLabel="Select a leave type" itemValue=""/> 
						<f:selectItems value="#{leaveTypesBean.leaveTypesMap}" />
						<p:ajax event="change" listener="#{leaveTypesBean.leaveTypeChangeListener}" update="@form"/>
					</p:selectOneMenu>
				</h:panelGrid>
				
				<h:outputLabel value="Details for #{rolesBean.selectedRole.role} leave type " styleClass="outputTextSubTitle" rendered="#{leaveTypesBean.detailsForLeaveType}"/>
				
				<h:panelGrid columns="3" style="border: 1px solid #d9d9d9;" cellspacing="10" rendered="#{leaveTypesBean.detailsForLeaveType}">
		
						<h:outputLabel value="Leave Type " style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{leaveTypesBean.selectedLeaveType.leaveType}" />  
	                </p:inplace>
					
					<h:outputLabel value="Display Name " style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{leaveTypesBean.selectedLeaveType.displayname}"/>  
	                </p:inplace>
	                
					<h:outputLabel value="Display Order " style="font-size: 12px;" />
					<h:outputLabel value=" : " />	
					<p:inplace>  
					<p:inputText value="#{leaveTypesBean.selectedLeaveType.displayOrder}"/>  
	                </p:inplace>
					
					<h:outputLabel value="Description " style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputTextarea value="#{leaveTypesBean.selectedLeaveType.description}"  />  
	                </p:inplace>
					
					<h:inputHidden /><h:inputHidden />
					<p:commandButton  value="Save"  action="#{leaveTypesBean.updateResourceAction}" update="@form"/>
				
									
				</h:panelGrid>
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>

